--[[
Event handler for BaseApp.
--]]

local M = {}

local log = require("log"):new(...)
local event_handler = require("event_handler")
local user_mgr = require("user_mgr")
-- DEL local login_mgr = require("login.login_manager")

function M.on_disconnected(rpc_clt_id)
	log:info("Client(%u) disconnected.", rpc_clt_id)
	-- for manager user erase
	local account = user_mgr.get_user_account(rpc_clt_id)
	-- DEL login_mgr.erase_on_manager(account)
	user_mgr.erase(rpc_clt_id)
end  -- on_disconnected()

function M.register_all()
	log:debug("Register all base event handler.")
	local reg = event_handler
	reg.register("ClientDisconnected", M.on_disconnected)
end  -- register_handlers()

return M
